package org.xxpay.pay.channel.payeasepay;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

@Component
public class PayeasepayConfig {

    public final static String CHANNEL_NAME_PAYEASEPAY = "payeasepay"; 	// 渠道名称:首信易支付

    public final static String PAY_CHANNEL_PAYEASEPAY_BANK_B2C = CHANNEL_NAME_PAYEASEPAY + "_b2c";	// 首信易网银支付

    public static final String RETURN_PARAM_RETCODE = "retCode";	    // 通讯返回码
    public static final String RETURN_VALUE_SUCCESS = "success";        // 成功
    public static final String RETURN_VALUE_FAIL = "fail";              // 失败
    public static final String RETURN_VALUE_SENT = "sent";              // 成功接收支付结果
    public static final String RETURN_VALUE_ERROR = "error";            // 接收支付结果错误
    public static final String pubkeyName = "payease_cfca.cer";

    private String v_mid;                //商户编号
    private String pfxFile;              //私钥证书
    private String pfxPassword;
    private String aliasPassword;
    private String aliasName;
    private String reqUrl;               //提交地址

    public PayeasepayConfig() {
    }

    public PayeasepayConfig(String payParam) {
        Assert.notNull(payParam, "init transfarpay config error");
        JSONObject object = JSONObject.parseObject(payParam);
        this.v_mid = object.getString("v_mid");
        this.pfxFile = object.getString("pfxFile");
        this.pfxPassword = object.getString("pfxPassword");
        this.aliasPassword = object.getString("aliasPassword");
        this.aliasName = object.getString("aliasName");
        this.reqUrl = object.getString("reqUrl");
    }

    public String getV_mid() {
        return v_mid;
    }

    public void setV_mid(String v_mid) {
        this.v_mid = v_mid;
    }

    public String getPfxFile() {
        return pfxFile;
    }

    public void setPfxFile(String pfxFile) {
        this.pfxFile = pfxFile;
    }

    public String getPfxPassword() {
        return pfxPassword;
    }

    public void setPfxPassword(String pfxPassword) {
        this.pfxPassword = pfxPassword;
    }

    public String getAliasPassword() {
        return aliasPassword;
    }

    public void setAliasPassword(String aliasPassword) {
        this.aliasPassword = aliasPassword;
    }

    public String getAliasName() {
        return aliasName;
    }

    public void setAliasName(String aliasName) {
        this.aliasName = aliasName;
    }

    public String getReqUrl() {
        return reqUrl;
    }

    public void setReqUrl(String reqUrl) {
        this.reqUrl = reqUrl;
    }

}
